// JavaScript Document
function check()
{
   var username=document.getElementById("username").value;
   var password=document.getElementById("password").value;
   if(strlen(username)==0||strlen(password)==0)
   {
	   if(strlen(username)==0)
	      document.getElementById("wrong").innerHTML="请输入正确的用户名和密码";
	   else if(strlen(password)==0)
	      document.getElementById("wrong").innerHTML="密码为空,请重新输入";
	   return false;
   }
   else
   {
       return true;
   }
}
function strlen(str){
    var len = 0;
    for (var i=0; i<str.length; i++) { 
     var c = str.charCodeAt(i); 
    //单字节加1 
     if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) { 
       len++; 
     } 
     else { 
      len+=2; 
     } 
    } 
    return len;
}
function checkRegister()
{
   var username=document.getElementById("username2").value;
   var password=document.getElementById("password2").value;
   var yzm=document.getElementById("yzm").value;
   if(strlen(username)==0||strlen(password)==0||strlen(yzm)==0)
   {
	   if(strlen(username)==0)
	      document.getElementById("wrong2").innerHTML="请输入正确的手机号";
	   else if(strlen(password)==0)
	      document.getElementById("wrong3").innerHTML="密码为空,请重新输入";
	   else if(strlen(yzm)==0)
	      document.getElementById("wrong3").innerHTML="验证码为空,请重新输入";
	   return false;
   }
   else
   {
       return true;
   }
}
//切换到注册板块
$(document).ready(function(){
  $("#register").click(function(){
    $("#tab1").hide();
	$("#tab2").show();
	$("#moveSpe").animate({left:'180px'},'slow');
  });
});
//切换到登陆板块
$(document).ready(function(){
  $("#login").click(function(){
	$("#tab2").hide();
	$("#tab1").show();
	$("#moveSpe").animate({left:'0px'},'slow');
  });
});